package newmeeting;

import java.awt.*;

import javax.swing.*;

public class PersonRenderer implements ListCellRenderer{
	@Override
	public Component getListCellRendererComponent(JList list, Object value,
			int index, boolean isSelected, boolean cellHasFocus) {
		
		Person person = (Person) value; 
		JLabel label; 
 
		if (person.getName().equals("name here") && person.getPassword().equals("********")) { 
			label = new JLabel("New Person", JLabel.LEFT); 
		} 
		else { 
			label = new JLabel(person.getName(), JLabel.LEFT); 
		} 
		if (isSelected) { 
			label.setForeground(Color.RED); 
		} 
		return label;
		
	}

}
